package ai.people.netmon.telegram.domain.request.account;

import ai.people.netmon.framework.domain.searchmsg.request.DataQuery;
import ai.people.netmon.framework.domain.searchmsg.request.MessageRequest;
import ai.people.netmon.framework.model.request.PageKeyWordsRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
 * 发言信息
 *
 * @author yuanqinglong
 * @date 2022/1/11 19:00
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class SpeakMessageRequest extends PageKeyWordsRequest {


    /**
     * 分析类型（1:主题、2:群组、3:账号）
     */
    private String analysisType;
    /**
     * 账号id
     */
    @NotNull(message = "账号id不可为空")
    private String accountId;
    /**
     * 开始日期
     */
    private String startDate;
    /**
     * 结束日期
     */
    private String endDate;
    /**
     * 分析源(whatsapp,telegram,tor,instagram,facebook,twitter,youtube,ethereum)
     */
    private String analysisSource;


    /**
     * 创建信息数据查询
     *
     * @param analysisSource 分析源
     * @return {@link DataQuery}
     */
    public MessageRequest createMessageQuery( String analysisSource) {
        MessageRequest messageRequest = new MessageRequest();
        messageRequest.setSearchKeywords(this.getSearchKeywords());
        messageRequest.setOffset(getPageNo());
        messageRequest.setLimit(getPageSize());
        messageRequest.setStartDate(startDate);
        messageRequest.setEndDate(endDate);
        messageRequest.setAccountId(accountId);
        messageRequest.setSource(analysisSource);
        //infoDataQuery.setAuthor(new AuthorInfo(accountId, null));
        return messageRequest;
    }


}
